<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
export default {
    mixins: [Vue.prototype.$vFN.Mixins.Base, Vue.prototype.$vFN.Mixins.Edit],
    components: {
        SelectImageRadio: async () =>
            Vue.extend(await Vue.prototype.$vFN.Components.Base.SelectImageRadio()),
    },
    data() {
        return {
            appWindow: window,
            form: {
                realName: "",
                mobile: "",
                password: "",
                icon: "",
                status: 0,
                remark: "",
            },

            // 页面接口地址
            apiUrl: {
                create: "mall-site-portal/portal-admin/create",
                update: "mall-site-portal/portal-admin/update",
                detail: "mall-site-portal/portal-admin/getItem",
            },
        };
    },
    methods: {
        // 初始化
        async init() {
            // 初始化数据
            await this.mixinEdit_editBoxInit({
                model: "form",
                id: this.id,
            });
        },
        // 编辑修改的参数扩展方法
        mixinEdit_editDataExtend(data_) {
            // 添加
            if (this.mixinEdit_editType == "add") {
                this.isDisabled = false;
            }
            // 修改
            else if (this.mixinEdit_editType == "update") {
                if(data_.password == null) {
                    data_.password = "";
                }
            }

            return data_;
        },


    },
    mounted() {
        this.init();
    },
    activated() {},
};
</script>